 <?
 // toolbar
$config  = file_to_array ("scripts/_ps_tools.js"); 
$mmenu   = 0;
$toolbar_height_offset    = 0;
$this_file_type = my_content_type($filename); 
for ($e=0;$e<count($config);$e++) {
    $line = $config[$e];
	

    if (substr($line,0,4)=="menu") {    
	   $for=""; 
	   $mmenu = -($mmenu-1);	
	   parse_str($line);  
	   if ($for==$edit) { 
		   if ($mmenu==1) print "<div style='background-color:#99CCFF;padding:2px'><img style='border:inset 1px' width=20 height=20 align=absmiddle src='images/logo.jpg'>"; // <table bgcolor='' width=100% cellspacing=0 cellpadding=0>  <tr>";   
		   $toolbar_height_offset += 20;
	   } else $mmenu = 2;
	   if ($mmenu==2) {
	     //  if ($ql=="") print "&nbsp;<label disabled>|</label>&nbsp;<a href=\"javascript:fb_edit('l','l')\">Hide Toolbars</a>"; 
		  // else if ($ql=="k") print "&nbsp;<label disabled>|</label>&nbsp;<a href=\"#\" onclick=\"window.open(location.href.replace('l=k',''));self.close()\">Show Toolbars</a>"; 
	       print "</div>"; //  </tr></table>";  
		   $mmenu = 0;  
	   }
	} else if ($mmenu==1) { 
	    $ppc     = "";
	    $icon    = "";
	    $options = "";
	    $ftype   = "";
	    $display = "";
	    $caption = "";
	    $qfilter = "";
	    $qvalue  = ""; 
	    $action  = ""; 
	    $onclick = ""; 
		$style   = "";
	    $option  = array();
	    parse_str($line);  
		
		$bok = true;
		if (is_array($ftype)) {
		
		} else if (strlen($ftype)>0) {
		    $bok=strpos($ftype,$this_file_type)>0;
		} 
		if (strlen($ppc)>0) {
		    $bok= $bok&&!$is_pocketpc;
		} 
		
		if ($bok) { 
			print "<span title='".$title."'>";
			if ($caption=="-") { 
				print "&nbsp;<label disabled>|</label>&nbsp;"; 
			} else if (strlen($qfilter)>0) { 
			    $url_value = $_GET[$qfilter];
				$action=$action==""?"#":$action;
				if ($url_value==$qvalue) {
					if (strlen($icon)>0) { 
						 print "&nbsp;<a style='".$style."' href='".stripslashes($action)."' onclick='".stripslashes($onclick)."'>";
						 print "<img border='0' align=absmiddle src='".$href."?i=".$icon."'></a>";  
					} 
				    print "<a href='".stripslashes($action)."' onclick='".stripslashes($onclick)."'>".$caption."</a>";  
				}
			} else if (strlen($options)==0) { 
				if (strlen($icon)>0) { 
					 print "&nbsp;<a href='".stripslashes($action)."' onclick='".stripslashes($onclick)."'>";
					 print "<img border='0' align=absmiddle src='".$href."?i=".$icon."'></a>"; 
				} 
			    print "<a href='".stripslashes($action)."' onclick='".stripslashes($onclick)."'>".$caption."</a>";  
			}
			
			
			if (strlen($options)>0) {
			    if ($display=="toggle") {
					if (strlen($icon)>0) { 
						 print "&nbsp;<a href='".stripslashes($action)."' onclick='".stripslashes($onclick)."'>";
						 print "<img border='0' align=absmiddle src='".$href."?i=".$icon."'></a>"; 
					} 
				   $opt_true  = explode(',',trim($option[0]));
				   $opt_false = explode(',',trim($option[1])); 
				   $url_value   = $_GET[$opt_true[1]];
				   print "<a ";
				   if ($url_value==$opt_true[2]) print " style='background-color:white'";
				   print "href=\"javascript:fb_edit('".$opt_true[1]."','".($url_value==$opt_true[2]?$opt_false[2]:$opt_true[2])."')\"";
				   print ">".$options."</a>";
				} else { 
					if (strlen($icon)>0) { 
						 print "&nbsp;<a href='".stripslashes($action)."' onclick='".stripslashes($onclick)."'>";
						 print "<img border='0' align=absmiddle src='".$href."?i=".$icon."'></a>"; 
					} 
					print "<b>".$options."</b>&nbsp;";
					for ($o=0;$o<count($option);$o++) {
						$opts = explode(',',trim($option[$o]));
						print "<a ";
						if ($_GET[$opts[1]]!=$opts[2]) {
							print "href=\"javascript:fb_edit(";
							$as = "";
							for ($p=1;$p<count($opts);$p++) $as .= ($as==""?"":",")."'".stripslashes($opts[$p])."'"; 
							print $as.")\"";
						}
						if ($_GET[$opts[1]]==$opts[2]) print " style='background-color:white'";
						print ">".$opts[0]."</a>&nbsp;";
					}
				}
			} 
			print "</span>";
		}
	} 
}	

 ?>